package com.feiyi.app.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.feiyi.app.R;
import com.feiyi.app.bean.RegionBean;

import java.util.List;

/**
 * @author wangliantao
 * @time 2018 11 2018/11/18 11:11 PM
 * @email 1346947404@qq.com
 * @package com.feiyi.app.adapter
 * @describe： In me the tiger sniffs the rose
 */
public class RegionAdapter extends BaseQuickAdapter<RegionBean.DataBean.RegionsBean,BaseViewHolder> {
    public RegionAdapter(int layoutResId, @Nullable List<RegionBean.DataBean.RegionsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RegionBean.DataBean.RegionsBean item) {
        helper.setText(R.id.tv_region_name,item.getName());
        if (item.isSelected()){
            helper.setVisible(R.id.iv_region_ok,true);
        }else {
            helper.setVisible(R.id.iv_region_ok,false);
        }
    }
}
